<?php

/**
 * @copyright   FOSP
 * @version     20120411
 * @todo        Format rating player data
 * @name        Fpt_Business_RatingPlayer_Metadata_RatingPlayer
 * @author      QuangTM 
 */
class Fpt_Business_RatingPlayer_Metadata_RatingPlayer
{
    
    /**
     *
     * @var int
     */
    private $_matchID;
    
    /**
     *
     * @var int
     */
    private $_teamID;
    
    /**
     *
     * @var int
     */
    private $_playerID;
    
    /**
     *
     * @var int
     */
    private $_userID;
    
    /**
     *
     * @var int
     */
    private $_rating;

    public function __construct()
    {
        $this->_matchID = 0;
        $this->_playerID = 0;
        $this->_rating = 0;
        $this->_teamID = 0;
        $this->_userID = 0;
    }
    
    public function __destruct()
    {
        unset($this->_matchID, $this->_playerID, $this->_rating, $this->_teamID, $this->_userID);
    }
    
    /**
     * Initialize data
     * @param array $entity
     * @return Fpt_Business_RatingPlayer_Metadata_RatingPlayer 
     */
    public function init($entity)
    {
        $this->_matchID = intval($entity['match_id']);
        $this->_playerID = intval($entity['player_id']);
        $this->_rating = intval($entity['rating']);
        $this->_teamID = intval($entity['team_id']);
        $this->_userID = intval($entity['user_id']);
        return $this;
    }
    
    /**
     * Get formated data
     * @return array
     */
    public function getFormatedData()
    {
        return array(
            'MatchID'  => $this->_matchID,
            'TeamID'   => $this->_teamID,
            'PlayerID' => $this->_playerID,
            'UserID'   => $this->_userID,
            'Rating'   => $this->_rating,
        );
    }

}